import request from '@/utils/request'

// 公告下拉菜单数据
export function bulletinOptions() {
    return request({
      url: '/bulletin/options.do',
      method: 'post'
    })
  }


// 平台下拉菜单数据
export function gamePlatformOpt() {
    return request({
      url: '/gamePlatform/options.do',
      method: 'post'
    })
  }


// 渠道下拉菜单数据
export function gameChannelOpt() {
    return request({
      url: '/gameChannel/options.do',
      method: 'post'
    })
  }


// 渠道大区下拉菜单数据
export function gameChannelRegionOpt(data) {
    const formData = new FormData()
    for (const key in data) {
      formData.append(key, data[key])
    }
    return request({
      url: '/gameRegion/options.do',
      method: 'post',
      data: formData
    })
  }


// 服务器根据平台分组的查询选择数据
export function serverGroupOpt() {
  return request({
    url:'/gameServer/optionsByPlatform.do',
    method: 'post'
  })
}

// 渠道下当前的服务器
export function channelServerOpt(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/gameChannelServer/currRelation.auth',
    method: 'post',
    data: formData
  })
}

// 服务器下拉菜单数据
export function serverOpt() {
  return request({
    url: '/gameServer/options.do',
    method: 'post',
  })
}

//根据渠道ID获取与之关联的服务器下拉菜单数据
export function serverByChannelOpt(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/gameServer/optionsByChannel.do',
    method: 'post',
    data: formData
  })
}





// 热更配置
export function fixDesign(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/fixDesign/data.auth',
    method: 'post',
    data: formData
  })
}

// 热更配置结果
export function fixDesignResult(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/fixDesignResult/data.auth',
    method: 'post',
    data: formData
  })
}

// 重发热更配置
export function resendFixDesign(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/fixDesign/resend.auth',
    method: 'post',
    data: formData
  })
}